
package com.crowdfunding.circle.admin.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.crowdfunding.circle.activity.entity.ActivityInfoVO;
import com.crowdfunding.circle.activity.param.ActivityInfoParam;
import com.crowdfunding.circle.activity.service.ActivityInfoService;
import com.crowdfunding.circle.common.controller.BaseController;

/**
 * Controller
 *
 * @author 朱国军
 * @since 1.0
 * @version 2015年12月27日 朱国军
 */
@Controller
public class AdminController extends BaseController {
    
    @Autowired
    private ActivityInfoService activityInfoService;

    private final static String ACTIVITY_LIST_PAGE = "/admin/activity_manage";
    
    private static final String STAT_PAGE = "/admin/stat_info";

    @RequestMapping(value = "/admin/activity/list")
    public ModelAndView queryList(ActivityInfoParam activityInfo) {

        Map<String, Object> resultMap = new HashMap<String, Object>();
        List<ActivityInfoVO> dataList = activityInfoService.queryByPage(activityInfo);
        resultMap.put("dataList", dataList);
        resultMap.put("paramMap", activityInfo);
        return new ModelAndView(ACTIVITY_LIST_PAGE, resultMap);
    }
    
    @RequestMapping(value = "/admin/stat/info")
    public ModelAndView queryStatData() {
        Map<String, Object> resultMap = new HashMap<String, Object>();
        resultMap.put("statData", null);
        return new ModelAndView(STAT_PAGE, resultMap);
    }
}
